#region imports

using System;
using System.Text;
using System.ComponentModel;
using System.Xml;
using System.Xml.Linq;
using System.Xml.Serialization;
using System.Collections.Generic;
using MimeCloud.AssetManagement.Business.Interface;

#endregion

namespace MimeCloud.AssetManagement.Business
{
    [Serializable]
    public class Status : IStatus
    {
        #region properties

        [XmlElement ( "id" )]
        public int ID { get; set; }

        [XmlElement ( "name" )]
        public string Name { get; set; }

        [XmlIgnore]
        public string Description { get; set; }

        [XmlElement ( "enabled" )]
        public bool Enabled { get; set; }

        #endregion

        #region constructors

        public Status ( ) { }

        public Status ( int id , string name , string description , bool enabled )
        {
            this.ID = id;
            this.Name = name;
            this.Description = description;
            this.Enabled = enabled;
        }

        public Status ( IStatus entity )
        {
            this.ID = entity.ID;
            this.Name = entity.Name;
            this.Description = entity.Description;
            this.Enabled = entity.Enabled;
        }

        #endregion

        #region overridden methods

        public override string ToString ( )
        {
            StringBuilder str = new StringBuilder ( );

            str.Append ( "-> ID: " + this.ID.ToString ( ) );
            str.Append ( "-> Name: " + this.Name );
            str.Append ( "-> Description: " + this.Description );
            str.Append ( "-> Enabled: " + this.Enabled.ToString ( ) );

            return str.ToString ( );
        }

        #endregion
    }
}
